home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / pasnet.arc / PASNETA.ASM
Assembly Source File  |  1988-07-18  |  25KB  |  1,535 lines

  1. title Turbo Pascal - NetWare Interface Module
  2.  
  3. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++
  4. ;+                               +
  5. ;+ For the following Turbo Pascal interface see        +
  6. ;+ the Borland Turbo Tutor manual and the           +
  7. ;+ Reference Manual                       +
  8. ;+                               +
  9. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++
  10. ; Modified by Joe R. Doupnik, 13 July 1988 for use with small or large
  11. ; memory model of Borland Turbo Pascal Version 4.0
  12. ; Assemble by command:  MASM pasneta;
  13. ; produces file pasneta.obj
  14. ; Use in program: {$L Pasneta}
  15. ;
  16. ;
  17.  
  18. lprog    equ    1        ; 0 for small memory, 1 for large memory model
  19.                 ; Modify lprog to match the memory model
  20.  
  21.     if    lprog
  22. x    equ    6        ; prologue overhead for large memory model
  23.     else
  24. x    equ    4        ; ditto, small memory model
  25.     endif
  26.  
  27. begin    macro    name        ; begin a function, near or far
  28.     public  name
  29.     if    lprog
  30. name    proc    far
  31.     else
  32. name    proc    near
  33.     endif
  34.     endm
  35.                 ; define Borland Pascal V4 segments
  36.                 ; use neither Group nor Class
  37. data    segment word public
  38. data    ends
  39.  
  40. cseg    segment byte public
  41.     assume    cs:cseg, ds:data, es:nothing
  42.  
  43.  
  44. ;--------------------------------
  45. ; Extended Open a File func(61) (3DH)
  46. ;
  47. ; var
  48. ;    Mode, Handle, RetCode : Integer;
  49. ;    Filename          : String[n];
  50. ;
  51. ; RetCode := xtndopn(Mode, Handle, Filename);
  52. ;
  53.  
  54. begin    xtndopn
  55.     push    bp
  56.     mov    bp,sp
  57.     push    ds
  58.     lds    si,[bp+x+8]      ; put the mode in ax
  59.     mov    ax,[si]
  60.     mov    ah,03Dh         ; put the function in ah
  61.     lds    dx,[bp+x]       ; ptr to ASCIIZ string
  62.     inc    dx            ; add 1 to get to the beginning of the string
  63.     int    21h
  64.     jc    xtndopx        ; carry set means failure
  65.     lds    di,[bp+x+4]       ; put the handle into the variable
  66.     mov    [di],ax          ; if there is no error and
  67.     xor    ax,ax             ; return a 0
  68. xtndopx:pop    ds
  69.     pop    bp
  70.     ret    14
  71. xtndopn endp
  72.  
  73.  
  74. ;--------------------------------
  75. ; Get or Set File Attributes(handle) func(67) (43H)
  76. ;
  77. ; var
  78. ;    Func, Attribute, ErrCode : Integer;
  79. ;    Filename         : String[n];
  80. ;
  81. ;ErrCode := setattr(Func, Attribute, Filename);
  82. ;
  83.  
  84. begin    setattr
  85.     push    bp
  86.     mov    bp,sp
  87.     push    ds
  88.     lds    si,[bp+x+8]      ; put the subfunction in ax
  89.     mov    ax,[si]
  90.     mov    ah,043h         ; put the function in ah
  91.     lds    dx,[bp+x]       ; ptr to var desc block for ASCIIZ string
  92.     inc    dx            ; add 1 to get the address of the string
  93.     lds    si,[bp+x+4]     ; put the attribute to set in cx
  94.     mov    cx,[si]
  95.     int    21h
  96.     jc    setattx        ; carry set means failure
  97.     lds    di,[bp+x+4]       ; put the returned attributes in the
  98.     mov    [di],cx         ; variable if there is no error
  99.     xor    ax,ax            ; and return zero
  100. setattx:mov    ah,0
  101.     pop    ds
  102.     pop    bp
  103.     ret    14
  104. setattr endp
  105.  
  106. ;--------------------------------
  107. ; End of Job Flag Status func(187) (BBH)
  108. ;
  109. ; var
  110. ;    Flag : Integer;
  111. ;
  112. ;ErrCode := eojstat(Flag);
  113. ;
  114.  
  115. begin    eojstat
  116.     push    bp
  117.     mov    bp,sp
  118.     push    ds
  119.     lds    si,[bp+x]       ; put the flag in ax
  120.     mov    ax,[si]
  121.     mov    ah,0BBh         ; put the function in ah
  122.     int    21h
  123.     mov    ah,0
  124.     lds    di,[bp+x]
  125.     mov    [di],ax
  126.     pop    ds
  127.     pop    bp
  128.     ret    6
  129. eojstat endp
  130.  
  131.  
  132. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  133. ;
  134. ; Physical Record Lock: Log Record   BCH
  135. ;
  136. ; var
  137. ;    ErrCode,FileHandle,HiByteOffset,LoByteOffset : Integer
  138. ;    HiLockLen,LoLockLen,Flags,TimeOut         : Integer
  139. ;
  140. ;ErrCode := PRLH_Log(FileHandle,HiByteOffset,LoByteOffset,HiLockLen,
  141. ;             LoLockLen,Flags,TimeOut);
  142. ;
  143.  
  144. begin    PRLH_Log
  145.     push    bp
  146.     mov    bp,sp
  147.     push    ds
  148.     lds    si,[bp+x+24]    ; FileHandle
  149.     mov    bx,[si]
  150.     lds    si,[bp+x+20]    ; ByteOffset
  151.     mov    cx,[si]
  152.     lds    si,[bp+x+16]
  153.     mov    dx,[si]
  154.     lds    si,[bp+x+4]    ; AL = Log Flags
  155.     mov    ax,[si]
  156.     lds    si,[bp+x+12]    ; LockLen
  157.     mov    si,[si]
  158.     lds    di,[bp+x+8]
  159.     mov    di,[di]
  160.     lds    bp,[bp+x]    ; time out
  161.     mov    bp,[bp]
  162.     mov    ah,0BCH
  163.     int    21H
  164.     mov    ah,0          ; clear the high byte of the return
  165.     pop    ds
  166.     pop    bp
  167.     ret    30
  168. PRLH_Log endp
  169.  
  170.  
  171.  
  172. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  173. ;
  174. ; Physical Record Lock: Release Rec  BDH
  175. ;
  176. ; var
  177. ;    FileHandle,HiByteOffset,LoByteOffset,ErrCode,
  178. ;  HiWordLen,LoWordLen : integer;
  179. ; ErrCode := PRLH_Rel(FileHandle,HiByteOffset,LoByteOffset,HiWordLen,
  180. ;                           LoWordLen:integer);
  181.  
  182. begin    PRLH_Rel
  183.     push    bp
  184.     mov    bp,sp
  185.     push    ds
  186.     lds    si,[bp+x+16]      ; FileHandle
  187.     mov    bx,[si]
  188.     lds    si,[bp+x+12]      ; HiByteOffset
  189.     mov    cx,[si]
  190.     lds    si,[bp+x+8]      ; LoByte
  191.     mov    dx,[si]
  192.     lds    si,[bp+x+4]      ; HiWordLen
  193.     mov    si,[si]
  194.     lds    di,[bp+x]      ; LoWordLen
  195.     mov    di,[di]
  196.     mov    ah,0BDH
  197.     int    21H
  198.     mov    ah,0
  199.     pop    ds
  200.     pop    bp
  201.     ret    22
  202. PRLH_Rel endp
  203.  
  204.  
  205.  
  206. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  207. ;
  208. ; Physical Record Lock: Release Clr  BEH
  209. ;
  210. ; var
  211. ; FileHandle,HiByteOffset,LoByteOffset,ErrCode,
  212. ;  HiWordLen,LoWordLen : integer;
  213. ; ErrCode := PRLH_Rel(FileHandle,HiByteOffset,LoByteOffset,HiWordLen,
  214. ;                           LoWordLen:integer);
  215. ;
  216.  
  217. begin    PRLH_Clr
  218.     push    bp
  219.     mov    bp,sp
  220.     push    ds
  221.     lds    si,[bp+x+16]    ; FileHandle
  222.     mov    bx,[si]
  223.     lds    si,[bp+x+12]    ; ByteOffset
  224.     mov    cx,[si]
  225.     lds    si,[bp+x+8]
  226.     mov    dx,[si]
  227.     lds    si,[bp+x+4]    ; HiWordLen
  228.     mov    si,[si]
  229.     lds    di,[bp+x]    ; LoWordLen
  230.     mov    di,[di]
  231.     mov    ah,0BEH
  232.     int    21H
  233.     mov    ah,0
  234.     pop    ds
  235.     pop    bp
  236.     ret    22
  237. PRLH_Clr endp
  238.  
  239.  
  240. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  241. ;
  242. ; Physical Record Lock: Log Rec FCB BFH
  243. ;
  244. ; var
  245. ;    ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
  246. ;    HiLockLen,LoLockLen,Flags,TimeOut     : Integer;
  247. ;
  248. ; ErrCode := PRLF_Log(fcb,HiByteOffset,LoByteOffset,HiLockLen,LoLockLen,Flags,TimeOut);
  249. ;
  250.  
  251. begin    PRLF_Log
  252.     push    bp
  253.     mov    bp,sp
  254.     push    ds
  255.     lds    si,[bp+x+24]    ; FCB
  256.     mov    dx,[si]
  257.     lds    si,[bp+x+20]    ; ByteOffset
  258.     mov    bx,[si]
  259.     lds    si,[bp+x+16]
  260.     mov    cx,[si]
  261.     lds    si,[bp+x+4]    ; AL = Log Flags
  262.     mov    ax,[si]
  263.     lds    si,[bp+x+8]    ; low lock length
  264.     mov    di,[si]
  265.     lds    si,[bp+x+12]    ; hi lock length
  266.     mov    si,[si]
  267.     mov    bp,[bp+x]    ; timeout value
  268.     mov    bp,[bp]
  269.     mov    ah,0BFH
  270.     int    21H
  271.     mov    ah,0
  272.     pop    ds
  273.     pop    bp
  274.     ret    28
  275. PRLF_Log endp
  276.  
  277.  
  278.  
  279. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  280. ;
  281. ; Physical Record Lock: Rel Rec FCB C0H
  282. ;
  283. ; var
  284. ;    ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
  285. ;
  286. ; ErrCode := PRLF_Rel(fcb,HiByteOffset,LoByteOffset);
  287. ;
  288.  
  289. begin    PRLF_Rel
  290.     push    bp
  291.     mov    bp,sp
  292.     push    ds
  293.     lds    dx,[bp+x+8]    ; FCB
  294.     lds    si,[bp+x+4]    ; ByteOffset
  295.     mov    bx,[si]
  296.     lds    si,[bp+x]
  297.     mov    cx,[si]
  298.     mov    ah,0C0H
  299.     int    21H
  300.     mov    ah,0
  301.     pop    ds
  302.     pop    bp
  303.     ret    12
  304. PRLF_Rel endp
  305.  
  306.  
  307.  
  308. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  309. ;
  310. ; Physical Record Lock: Clr Rec FCB C1H
  311. ;
  312. ; var
  313. ;    ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
  314. ;
  315. ; ErrCode := PRLF_clr(fcb,HiByteOffset,LoByteOffset);
  316. ;
  317.  
  318. begin    PRLF_Clr
  319.     push    bp
  320.     mov    bp,sp
  321.     push    ds
  322.     lds    dx,[bp+x+8]    ; FCB
  323.     lds    si,[bp+x+4]    ; ByteOffset
  324.     mov    bx,[si]
  325.     lds    si,[bp+x]
  326.     mov    cx,[si]
  327.     mov    ah,0C0H
  328.     int    21H
  329.     mov    ah,0
  330.     pop    ds
  331.     pop    bp
  332.     ret    12
  333. PRLF_Clr endp
  334.  
  335.  
  336. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  337. ;
  338. ; Lock Record Set  C2H
  339. ;
  340. ; var
  341. ;    ErrCode, Flags, TimeOut : Integer;
  342. ;
  343. ; ErrCode := PRLS_Lck(Flags,TimeOut);
  344. ;
  345.  
  346. begin    PRLS_Lck
  347.     push    bp
  348.     mov    bp,sp
  349.     push    ds
  350.     lds    si,[bp+x+4]    ; AL = Lock flag bits
  351.     mov    ax,[si]
  352.     lds    si,[bp+x]    ; TimeOut Value
  353.     mov    bp,[si]
  354.     mov    ah,0C2h
  355.     int    21h
  356.     mov    ah,0
  357.     pop    ds
  358.     pop    bp
  359.     ret    10
  360. PRLS_Lck endp
  361.  
  362.  
  363.  
  364. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  365. ;
  366. ; Release Record Set  C3H
  367. ;
  368. ; var
  369. ;    ErrCode : Integer;
  370. ;
  371. ; ErrCode := PRLS_Rel;
  372. ;
  373.  
  374. begin    PRLS_Rel
  375.     mov    ah,0C3h
  376.     int    21h
  377.     mov    ah,0
  378.     ret
  379. PRLS_Rel endp
  380.  
  381.  
  382.  
  383. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  384. ;
  385. ; Clear Record Set  C4H
  386. ;
  387. ; var
  388. ;    ErrCode : Integer;
  389. ;
  390. ; errcode := PRLS_Clr;
  391. ;
  392.  
  393. begin    PRLS_Clr
  394.     mov    ah,0C4h
  395.     int    21h
  396.     mov    ah,0
  397.     ret
  398. PRLS_Clr endp
  399.  
  400.  
  401. ;--------------------------------
  402. ; Semaphores func(197) (C5H) subfunction 00h
  403. ;
  404. ; var
  405. ;    RetCode,SemaValu,HiHandle,LoHandle,OpenCnt : Integer;
  406. ;    Sema4 : String[n];
  407. ;
  408. ; RetCode := OpenSem(Sema4,SemaValu,HiHandle,LoHandle,OpenCnt);
  409. ;
  410.  
  411. begin    OpenSem
  412.     push    bp
  413.     mov    bp,sp
  414.     push    ds
  415.     lds    dx,[bp+x+16]    ; ptr to Semaphore string
  416. ;    inc    dx            ; add 1 to get the address of the string
  417.     lds    si,[bp+x+12]    ; set semaphore value
  418.     mov    cx,[si]
  419.     mov    ax,0C500h    ; set the function
  420.     int    21h
  421.     mov    bh,00h
  422.     lds    di,[bp+x]    ; return the open count
  423.     mov    [di],bx
  424.     lds    di,[bp+x+4]      ; return low handle
  425.     mov    [di],cx
  426.     lds    di,[bp+x+8]    ; return high handle
  427.     mov    [di],dx
  428.     mov    ah,00h
  429.     pop    ds
  430.     pop    bp
  431.     ret    22
  432. OpenSem endp
  433.  
  434.  
  435. ;--------------------------------
  436. ; Semaphores func(197) (C5H) subfunction 01h
  437. ;
  438. ; var
  439. ;    RetCode,HiHandle,LoHandle,SemaValu,OpenCnt : Integer;
  440. ;
  441. ; RetCode := ExamSem(HiHandle,LoHandle,SemaValu,OpenCnt);
  442. ;
  443.  
  444. begin    ExamSem
  445.     push    bp
  446.     mov    bp,sp
  447.     push    ds
  448.     lds    si,[bp+x+12]    ; hi handle
  449.     mov    dx,[si]
  450.     lds    si,[bp+x+8]    ; lo handle
  451.     mov    cx,[si]
  452.     mov    ax,0C501h    ; set function
  453.     int    21h
  454.     lds    di,[bp+x+4]    ; return semaphore value
  455.     mov    [di],cx
  456.     mov    dh,00h
  457.     lds    di,[bp+x]
  458.     mov    [di],dx     ; return open count
  459.     mov    ah,00h
  460.     pop    ds
  461.     pop    bp
  462.     ret    16
  463. ExamSem endp
  464.  
  465.  
  466. ;--------------------------------
  467. ; Semaphores func(197) (C5H) subfunction 02h
  468. ;
  469. ; var
  470. ;    RetCode,HiHandle,LoHandle,TimeOut : Integer;
  471. ;
  472. ; RetCode := WaitSem(HiHandle,LoHandle,TimeOut);
  473. ;
  474.  
  475. begin    WaitSem
  476.     push    bp
  477.     mov    bp,sp
  478.     push    ds
  479.     lds    si,[bp+x+8]    ; hi handle
  480.     mov    dx,[si]
  481.     lds    si,[bp+x+4]    ; lo handle
  482.     mov    cx,[si]
  483.     lds    si,[bp+x]
  484.     mov    bp,[si]     ; set time out
  485.     mov    ax,0C502h    ; set function
  486.     int     21h
  487.     mov    ah,00h
  488.     pop    ds
  489.     pop    bp
  490.     ret    12
  491. WaitSem endp
  492.  
  493.  
  494. ;--------------------------------
  495. ; Semaphores func(197) (C5H) subfunction 03h
  496. ;
  497. ; var
  498. ;    RetCode,HiHandle,LoHandle : Integer;
  499. ;
  500. ; RetCode := SigSem(HiHandle,LoHandle);
  501. ;
  502.  
  503. begin    SigSem
  504.     push    bp
  505.     mov    bp,sp
  506.     push    ds
  507.     lds    si,[bp+x+4]    ; hi handle
  508.     mov    dx,[si]
  509.     lds    si,[bp+x]    ; lo handle
  510.     mov    cx,[si]
  511.     mov    ax,0C503h    ; set function
  512.     int    21h
  513.     mov    ah,00h
  514.     pop    ds
  515.     pop    bp
  516.     ret    8
  517. SigSem    endp
  518.  
  519.  
  520. ;--------------------------------
  521. ; Semaphores func(197) (C5H) subfunction 04h
  522. ;
  523. ; var
  524. ;    RetCode,HiHandle,LoHandle : Integer;
  525. ;
  526. ; RetCode := ClosSem(HiHandle,LoHandle);
  527. ;
  528.  
  529. begin    ClosSem
  530.     push    bp
  531.     mov    bp,sp
  532.     push    ds
  533.     lds    si,[bp+x+4]    ; hi handle
  534.     mov    dx,[si]
  535.     lds    si,[bp+x]    ; lo handle
  536.     mov    cx,[si]
  537.     mov    ax,0C504h    ; set function
  538.     int    21h
  539.     mov    ah,00h
  540.     pop    ds
  541.     pop    bp
  542.     ret    8
  543. ClosSem endp
  544.  
  545.  
  546. ;--------------------------------
  547. ; Get or Set Lock Mode func(198) (C6H)
  548. ;
  549. ; var
  550. ;    Mode,Func : Integer;
  551. ;
  552. ; Mode := setlck(Func);
  553. ;
  554.  
  555. begin    setlck
  556.     push    bp
  557.     mov    bp,sp
  558.     push    ds
  559.     lds    si,[bp+x]
  560.     mov    ax,[si]     ; set the subfunction
  561.     mov    ah,0C6h     ; set the function
  562.     int    21h
  563.     mov    ah,0
  564.     pop    ds
  565.     pop    bp
  566.     ret    4
  567. setlck endp
  568.  
  569. ;--------------------------------
  570. ; Transactional Backout func(199) (C7H)
  571. ;
  572. ; var
  573. ;    RetCode, Func : Integer;
  574. ;
  575. ; RetCode := BakOuts(Func);
  576. ;
  577.  
  578. begin    BakOuts
  579.     push    bp
  580.     mov    bp,sp
  581.     push    ds
  582.     lds    si,[bp+x]    ; set the subfunction
  583.     mov    ax,[si]
  584.     mov    ah,0C7h     ; set the function
  585.     int    21h
  586.     mov    ah,0
  587.     pop    ds
  588.     pop    bp
  589.     ret    4
  590. BakOuts endp
  591.  
  592.  
  593. ;--------------------------------
  594. ; Begin transaction  func(200) (C8H)
  595. ;
  596. ; var
  597. ;    RetCode,Mode : Integer;
  598. ;
  599. ; RetCode := btrans(Mode);
  600. ;
  601.  
  602. begin    btrans
  603.     mov    ah,0C8h
  604.     call    arg1t
  605.     ret    4
  606. btrans    endp
  607.  
  608.  
  609.  
  610. ;--------------------------------
  611. ; End Transaction func(201) (C9H)
  612. ;
  613. ; var
  614. ;    RetCode : Integer;
  615. ;
  616. ; RetCode := etrans;
  617. ;
  618.  
  619. begin    etrans
  620.     mov    ah,0C9H
  621.     int    021h
  622.     mov    ah,00h
  623.     ret
  624. etrans    endp
  625.  
  626.  
  627.  
  628. ;--------------------------------
  629. ; Exc.log File (202) (CA)
  630. ;
  631. ; var
  632. ;    RetCode, FcbAddr : Integer;
  633. ;
  634. ; RetCode := exclog(FcbAddr);
  635. ;
  636.  
  637. begin    exclog
  638.     mov    ah,0CAH
  639.     call    arg1f
  640.     ret    4
  641. exclog    endp
  642.  
  643.  
  644. ;--------------------------------
  645. ; Exc Lock Set    func(203) (CBH)
  646. ;
  647. ; var
  648. ;    RetCode, Mode : Integer;
  649. ;
  650. ; RetCode := exclcks(Mode);
  651. ;
  652.  
  653. begin    exclcks
  654.     mov    ah,0CBH
  655.     call    arg1
  656.     ret    4
  657. exclcks endp
  658.  
  659.  
  660.  
  661. ;--------------------------------
  662. ; Exclusive file unlock (204) (CC)
  663. ;
  664. ; var
  665. ;    RetCode, FcbAddr : Integer;
  666. ;
  667. ; RetCode := exculkf(FcbAddr);
  668. ;
  669.  
  670. begin    exculkf
  671.     mov    ah,0CCH
  672.     call    arg1f
  673.     ret    4
  674. exculkf endp
  675.  
  676.  
  677.  
  678. ;--------------------------------
  679. ; Exclusive Unlock Set (205)(CD)
  680. ;
  681. ; var
  682. ;    RetCode : Integer;
  683. ;
  684. ; RetCode := exculks;
  685. ;
  686.  
  687. begin    exculks
  688.     mov    ah,0CDH
  689.     int    21h
  690.     mov    ah,00h
  691.     ret
  692. exculks endp
  693.  
  694.  
  695.  
  696. ;--------------------------------
  697. ; Exc Clear file func(206) (CEH)
  698. ;
  699. ; var
  700. ;    RetCode, FcbAddr : Integer;
  701. ;
  702. ; RetCode := excclrf(FcbAddr);
  703. ;
  704.  
  705. begin    excclrf
  706.     mov    ah,0CEH
  707.     call    arg1f
  708.     ret    4
  709. excclrf endp
  710.  
  711.  
  712.  
  713. ;--------------------------------
  714. ; Exc Clear Set  func(207) (CFH)
  715. ;
  716. ; var
  717. ;    RetCode : Integer;
  718. ;
  719. ; RetCode := excclrs;
  720. ;
  721.  
  722. begin    excclrs
  723.     mov    ah,0CFH
  724.     int    21h
  725.     mov    ah,00h
  726.     ret
  727. excclrs endp
  728.  
  729.  
  730.  
  731. ;--------------------------------
  732. ; Log Record(s) func(208) (D0H)
  733. ;
  734. ; var
  735. ;    RetCode, Flag, Timeout : Integer ;
  736. ;    RecStr    : String[n];
  737. ;
  738. ; RetCode := reclog(RecStr,Flag,Timeout);
  739. ;
  740.  
  741. begin    reclog
  742.     push    bp
  743.     mov    bp,sp
  744.     push    ds
  745.     lds    si,[bp+x+4]    ; load flags
  746.     mov    ax,[si]
  747.     lds    si,[bp+x]    ; get timeout
  748.     mov    si,[si]
  749.     lds    dx,[bp+x+8]    ; get ptr to string
  750.     ; inc    dx
  751.     mov    bp,si          ; move timeout to BP
  752.     mov    ah,0D0h
  753.     int    21h
  754.     mov    ah,0
  755.     pop    ds
  756.     pop    bp
  757.     ret    14
  758. reclog    endp
  759.  
  760.  
  761. ;--------------------------------
  762. ; Record Lock func(209) (D1H)
  763. ;
  764. ; var
  765. ;    RetCode, Mode : Integer;
  766. ;
  767. ; RetCode := reclck(Mode);
  768. ;
  769.  
  770. begin    reclck
  771.     push    bp
  772.     mov    bp,sp
  773.     push    ds
  774.     lds    si,[bp+x]
  775.     mov    bp,[si]
  776.     mov    ah,0D1h
  777.     int    21h
  778.     mov    ah,0
  779.     pop    ds
  780.     pop    bp
  781.     ret    6
  782. reclck    endp
  783.  
  784.  
  785.  
  786. ;--------------------------------
  787. ; Record Unlock func(210) (D2H)
  788. ;
  789. ; var
  790. ;    RetCode   : Integer;
  791. ;    Semaphore : String[n];
  792. ;
  793. ; RetCode := reculk(Semaphore);
  794. ;
  795.  
  796. begin    reculk
  797.     mov    ah,0D2H
  798.     call    arg1a
  799.     ret    4
  800. reculk    endp
  801.  
  802.  
  803.  
  804. ;--------------------------------
  805. ; Unlock Record Set func(211) (D3H)
  806. ;
  807. ; var
  808. ;    RetCode : Integer;
  809. ;
  810. ; RetCode := reculks;
  811. ;
  812.  
  813. begin    reculks
  814.     mov    ah,0D3H
  815.     int    21h
  816.     mov    ah,00h
  817.     ret
  818. reculks endp
  819.  
  820.  
  821.  
  822. ;--------------------------------
  823. ; Record Clear func(212) (D4H)
  824. ;
  825. ; var
  826. ;    RetCode   : Integer;
  827. ;    Semaphore : String[n];
  828. ;
  829. ; RetCode := recclr(Semaphore);
  830. ;
  831.  
  832. begin    recclr
  833.     mov    ah,0D4H
  834.     call    arg1a
  835.     ret    4
  836. recclr    endp
  837.  
  838.  
  839.  
  840. ;--------------------------------
  841. ; Clear record set func(213) (D5H)
  842. ;
  843. ; var
  844. ;    RetCode : Integer;
  845. ;
  846. ; RetCode := recclrs;
  847. ;
  848.  
  849. begin    recclrs
  850.     mov    ah,0D5H
  851.     int    21h
  852.     mov    ah,00h
  853.     ret    4
  854. recclrs endp
  855.  
  856.  
  857.  
  858. ;--------------------------------
  859. ; End of Job  func(214) (D6H)
  860. ;
  861. ; var
  862. ;    RetCode : Integer;
  863. ;
  864. ; RetCode := eoj;
  865. ;
  866.  
  867. begin    eoj
  868.     mov    ah,0D6H
  869.     int    21h
  870.     mov    ah,00h
  871.     ret    4
  872. eoj    endp
  873.  
  874.  
  875.  
  876. ;--------------------------------
  877. ; Logout System  func(215) (D7H)
  878. ;
  879. ; var
  880. ;    RetCode : Integer;
  881. ;
  882. ; RetCode := sysout;
  883. ;
  884.  
  885. begin    sysout
  886.     mov    ah,0D7H
  887.     int    21h
  888.     mov    ah,00h
  889.     ret    4
  890. sysout    endp
  891.  
  892.  
  893.  
  894. ;--------------------------------
  895. ; Vol Statistics func(218) (DAH)
  896. ;
  897. ; var
  898. ;    RetCode,volume : Integer;
  899. ;    reply  : String[n];
  900. ;
  901. ; RetCode := volstat(volume, reply);
  902.  
  903. begin    volstat
  904.     mov    ah,0DAh
  905.     push    bp
  906.     mov    bp,sp
  907.     push    ds
  908.     push    es
  909.     lds    si,[bp+x+4]    ; addr for the volume number
  910.     mov    dx,[si]        ; get the volume number
  911.     les    di,[bp+x]    ; ptr to reply buffer
  912.     inc    di        ; add 1 to get the address of the string
  913.     int    21h
  914.     mov    ah,00h
  915.     pop    es
  916.     pop    ds
  917.     pop    bp
  918.     ret    8
  919. volstat endp
  920.  
  921.  
  922.  
  923. ;--------------------------------
  924. ; Local Disks  func(219) (DBH)
  925. ;
  926. ; var
  927. ;    NumDisks : Integer;
  928. ;
  929. ; NumDisks := locdrv;
  930. ;
  931.  
  932. begin    locdrv
  933.     mov    ah,0DBH
  934.     int    21h
  935.     mov    ah,00h
  936.     ret
  937. locdrv endp
  938.  
  939.  
  940.  
  941. ;--------------------------------
  942. ; WorkStation ID func(220) (DCH)
  943. ;
  944. ; note: This routine returns the station number as an integer.
  945. ;    It can also be returned in ASCII with this call.
  946. ;
  947. ; var
  948. ;    StationNum : Integer;
  949. ;
  950. ; StationNum := wsid;
  951. ;
  952.  
  953. begin    wsid
  954.        mov     ah,0DCH
  955.        int     21h
  956.        mov     ah,00h
  957.        ret
  958. wsid   endp
  959.  
  960.  
  961. ;--------------------------------
  962. ; Set Error mode func(221) (DDH)
  963. ;
  964. ; var
  965. ;    mode : Integer;
  966. ;
  967. ; errmode(mode);
  968. ;
  969.  
  970.  
  971. begin    errmode
  972.     mov    ah,0DDH
  973.     call    arg1
  974.     ret    4
  975. errmode endp
  976.  
  977.  
  978.  
  979. ;--------------------------------
  980. ; Broadcast Mode func(222) (DEH)
  981. ;
  982. ; var
  983. ;    mode : Integer;
  984. ;
  985. ; bcsmode(mode);
  986. ;
  987.  
  988. begin    bcsmode
  989.     mov    ah,0DEH
  990.     call    arg1
  991.     ret    4
  992. bcsmode endp
  993.  
  994.  
  995.  
  996. ;--------------------------------
  997. ; Modify LST Device  func(223) (DFH)
  998. ;
  999. ; var
  1000. ;    RetCode, Mode : Integer;
  1001. ;
  1002. ; RetCode := ctlspl(Mode);
  1003. ;
  1004.  
  1005. begin    ctlspl
  1006.     mov    ah,0DFh
  1007.     call    arg1
  1008.     ret    4
  1009. ctlspl    endp
  1010.  
  1011.  
  1012.  
  1013. ;--------------------------------
  1014. ; Spool Request func(224) (E0H)
  1015. ;
  1016. ; var
  1017. ;    ErrCode         : Integer;
  1018. ;    RequestBlock, Reply : String[n];
  1019. ;
  1020. ; ErrCode := splreq(RequestBlock, Reply);
  1021. ;
  1022.  
  1023. begin    splreq
  1024.     mov    ah,0E0h
  1025.     call    req_rep
  1026.     ret    8
  1027. splreq    endp
  1028.  
  1029.  
  1030.  
  1031. ;--------------------------------
  1032. ; Pipe Request func(225) (E1H)
  1033. ;
  1034. ; var
  1035. ;    ErrCode         : Integer;
  1036. ;    RequestBlock, Reply : String[n];
  1037. ;
  1038. ; ErrCode := pipreq(RequestBlock, Reply);
  1039. ;
  1040.  
  1041. begin    pipreq
  1042.     mov    ah,0E1h
  1043.     call    req_rep
  1044.     ret    8
  1045. pipreq    endp
  1046.  
  1047.  
  1048.  
  1049. ;--------------------------------
  1050. ; Directory Path func(226) (E2H)
  1051. ;
  1052. ; var
  1053. ;    ErrCode         : Integer;
  1054. ;    RequestBlock, Reply : String[n];
  1055. ;
  1056. ; ErrCode := dpath(RequestBlock, Reply);
  1057. ;
  1058.  
  1059. begin    dpath
  1060.     mov    ah,0E2h
  1061.     call    req_rep
  1062.     ret    8
  1063. dpath    endp
  1064.  
  1065.  
  1066.  
  1067. ;--------------------------------
  1068. ; Login system func(227) (E3H)
  1069. ;
  1070. ; var
  1071. ;    ErrCode         : Integer;
  1072. ;    RequestBlock, Reply : String[n];
  1073. ;
  1074. ; ErrCode := syslog(RequestBlock, Reply);
  1075. ;
  1076.  
  1077. begin    syslog
  1078.     mov    ah,0E3h
  1079.     call    req_rep
  1080.     ret    8
  1081. syslog    endp
  1082.  
  1083.  
  1084.  
  1085. ;--------------------------------
  1086. ; Set File Attribute func(228) (E4H)
  1087. ;
  1088. ; var
  1089. ;    RetCode, FcbAddr, Attribute : Integer;
  1090. ;
  1091. ; RetCode := fattr(FcbAddr, Attribute);
  1092. ;
  1093.  
  1094. begin    fattr
  1095.     push    bp
  1096.     mov    bp,sp
  1097.     push    ds
  1098.     lds    si,[bp+x]
  1099.     mov    cx,[si]        ; cx = attribute
  1100.     lds    dx,[bp+x+4]    ; dx = address of fcb
  1101.     mov    ah,0E4h
  1102.     int    21h
  1103.     mov    ah,0
  1104.     pop    ds
  1105.     pop    bp
  1106.     ret
  1107. fattr    endp
  1108.  
  1109.  
  1110.  
  1111. ;--------------------------------
  1112. ; Update file size func(229) (E5H)
  1113. ;
  1114. ; var
  1115. ;    ErrCode,FcbAddr : Integer;
  1116. ;
  1117. ; ErrCode := updfcb(FcbAddr);
  1118. ;
  1119.  
  1120. begin    updfcb
  1121.     mov    ah,0E5H
  1122.     call    arg1f
  1123.     ret    4
  1124. updfcb    endp
  1125.  
  1126.  
  1127.  
  1128. ;--------------------------------
  1129. ; Copy File to File func(230) (E6H)
  1130. ;
  1131. ; var
  1132. ;    RetCode,FcbSource,FcbDest : Integer;
  1133. ;    CountLow, CountHigh      : Integer;
  1134. ;
  1135. ; RetCode := cpyfile(FcbSource, FcbDest, CountLow, CountHigh)
  1136. ;
  1137. ;
  1138.  
  1139. begin    cpyfile
  1140.     mov    ah,0E6h
  1141.     push    bp
  1142.     mov    bp,sp
  1143.     push    ds
  1144.     push    es
  1145.     lds    si,[bp+x]    ; addr of the high byte cnt
  1146.     mov    dx,[si]        ; dx=high word of byte cnt
  1147.     lds    si,[bp+x+4]    ; addr low word of byte cnt
  1148.     mov    cx,[si]        ; cx=low 16 bits of count
  1149.     les    di,[bp+x+8]    ; address of dest fcb
  1150.     lds    si,[bp+x+12]    ; address of the source fcb
  1151.     int    21h
  1152.     mov    ah,0
  1153.     pop    es
  1154.     pop    ds
  1155.     pop    bp
  1156.     ret    16
  1157. cpyfile endp
  1158.  
  1159.  
  1160.  
  1161. ;--------------------------------
  1162. ; get time / date string func(231) (E7H)
  1163. ;
  1164. ; var
  1165. ;    time : String[n];
  1166. ;
  1167. ; nettod(time);
  1168. ;
  1169. ; where time is a string of the form Y M D H M S
  1170. ;
  1171.  
  1172. begin    nettod
  1173.     mov    ah,0E7h
  1174.     call    arg1a
  1175.     ret    4
  1176. nettod    endp
  1177.  
  1178.  
  1179.  
  1180. ;--------------------------------
  1181. ; Set Close mode func(232) (E8H)
  1182. ;
  1183. ; var
  1184. ;    mode : Integer;
  1185. ;
  1186. ; clsmode(mode);
  1187. ;
  1188.  
  1189. begin    clsmode
  1190.     mov    ah,0E8H
  1191.     call    arg1wor
  1192.     ret    4
  1193. clsmode endp
  1194.  
  1195.  
  1196. ;--------------------------------
  1197. ; Shell Base Status func(233) (E9H)
  1198. ;
  1199. ; var
  1200. ;    RetFlags, drive : Integer;
  1201. ;
  1202. ; RetFlags := drvmap(drive);
  1203. ;
  1204.  
  1205. begin    drvmap
  1206.     mov    ax,0E900h
  1207.     call    arg1
  1208.     ret    4
  1209. drvmap    endp
  1210.  
  1211.  
  1212. ;--------------------------------
  1213. ; Return Shell Version func(234) (EAH)
  1214. ;
  1215. ; var
  1216. ;    RetCode, Mode : Integer;
  1217. ;    EnvirStr      : String[n];
  1218. ;
  1219. ; RetCode := retshl(EnvirStr, Mode);
  1220. ;
  1221.  
  1222. begin    retshl
  1223.     push    bp
  1224.     mov    bp,sp
  1225.     push    ds
  1226.     push    es
  1227.     les    di,[bp+x+4]    ; set es:di to point at the buffer
  1228.     inc    di        ; point di at the start of the data area
  1229.     lds    si,[bp+x]    ; put the mode into al
  1230.     mov    ax,[si]
  1231.     mov    ah,0EAh
  1232.     int    21h
  1233.     mov    ah,00h
  1234.     pop    es
  1235.     pop    ds
  1236.     pop    bp
  1237.     ret    8
  1238. retshl    endp
  1239.  
  1240.  
  1241. ;--------------------------------
  1242. ; ascii log File (235) (EB)
  1243. ;
  1244. ; var
  1245. ;    RetCode, Flags, TimeOut : Integer;
  1246. ;    Asciiz            : String[n];
  1247. ;
  1248. ; RetCode := asclog(Flags, TimeOut, Asciiz);
  1249. ;
  1250.  
  1251. begin    asclog
  1252.     push    bp
  1253.     mov    bp,sp
  1254.     push    ds
  1255.     lds    si,[bp+x+8]
  1256.     mov    ax,[si]        ; flags into al
  1257.     lds    dx,[bp+x]    ; pointer to the asciiz string
  1258.     lds    si,[bp+x+4]
  1259.     mov    bp,[si]        ; time out into bp
  1260.     mov    ah,0EBH
  1261.     int    21h
  1262.     mov    ah,00h
  1263.     pop    ds
  1264.     pop    bp
  1265.     ret    12
  1266. asclog    endp
  1267.  
  1268.  
  1269. ;--------------------------------
  1270. ; ASCIIZ file unlock (236) (EC)
  1271. ;
  1272. ; var
  1273. ;    RetCode : Integer;
  1274. ;    Asciiz    : String[n];
  1275. ;
  1276. ; RetCode := asculkf(Asciiz);
  1277. ;
  1278.  
  1279. begin    asculkf
  1280.     mov    ah,0ECH
  1281.     call    arg1a
  1282.     ret    4
  1283. asculkf endp
  1284.  
  1285.  
  1286. ;--------------------------------
  1287. ; ASCIIZ Clear file func(237) (EDH)
  1288. ;
  1289. ; var
  1290. ;    RetCode : Integer;
  1291. ;    Asciiz    : String[n];
  1292. ;
  1293. ; RetCode := ascclrf(Asciiz);
  1294. ;
  1295.  
  1296. begin    ascclrf
  1297.     mov    ah,0EDH
  1298.     call    arg1a
  1299.     ret    4
  1300. ascclrf endp
  1301.  
  1302.  
  1303. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1304. ;
  1305. ; Get Physical Station Number  EEH
  1306. ;
  1307. ; var
  1308. ;    StationNo : Integer;
  1309. ;
  1310. ; StationNo := Get_PSN;
  1311. ;
  1312.  
  1313. begin    Get_PSN
  1314.     mov    ah,0EEh
  1315.     int    21h
  1316.     mov    ah,0
  1317.     ret
  1318. Get_PSN endp
  1319.  
  1320.  
  1321. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1322. ;
  1323. ; Get Shell Table Addresses (239) EFH
  1324. ;
  1325. ; var
  1326. ;    Mode,Segment,Offset : Integer;
  1327. ;
  1328. ; Get_STA(Mode,Segment,Offset);
  1329. ;
  1330.  
  1331. begin    Get_STA
  1332.     push    bp
  1333.     mov    bp,sp
  1334.     push    es
  1335.     push    ds
  1336.     mov    si,[bp+x+8]    ; get the mode
  1337.     mov    ax,[si]
  1338.     mov    ah,0EFh     ; set the function
  1339.     int    21h
  1340.     lds    di,[bp+x+4]    ; store the segment location
  1341.     mov    [di],es
  1342.     lds    di,[bp+x]    ; store the offset location
  1343.     mov    [di],si
  1344.     pop    ds
  1345.     pop    es
  1346.     pop    bp
  1347.     ret    12
  1348. Get_STA endp
  1349.  
  1350.  
  1351. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1352. ;
  1353. ; Set Preferred File Server (240) F0H
  1354. ;
  1355. ; var
  1356. ;    RetServer, Mode, NewServ : Integer;
  1357. ;
  1358. ; RetServer := SetServ(Mode,NewServ);
  1359. ;
  1360.  
  1361. begin    SetServ
  1362.     push    bp
  1363.     mov    bp,sp
  1364.     push    ds
  1365.     mov    si,[bp+x+4]    ; get the mode
  1366.     mov    ax,[si]
  1367.     mov    di,[bp+x]    ; set the preferred server number
  1368.     mov    dx,[di]
  1369.     mov    ah,0F0h     ; set the function
  1370.     int    21h
  1371.     mov    ah,0
  1372.     pop    ds
  1373.     pop    bp
  1374.     ret    6
  1375. SetServ endp
  1376.  
  1377.  
  1378. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1379. ;
  1380. ; Attach/Detach To File Server (241) F1H
  1381. ;
  1382. ; var
  1383. ;    RetCode, Mode, NewServ : Integer;
  1384. ;
  1385. ; RetCode := ModServ(Mode,NewServ);
  1386. ;
  1387.  
  1388. begin    ModServ
  1389.     push    bp
  1390.     mov    bp,sp
  1391.     push    ds
  1392.     lds    si,[bp+x+4]    ; get the mode
  1393.     mov    ax,[si]
  1394.     lds    di,[bp+x]    ; set the preferred server number
  1395.     mov    dx,[di]
  1396.     mov    ah,0F1h     ; set the function
  1397.     int    21h
  1398.     mov    ah,0
  1399.     pop    ds
  1400.     pop    bp
  1401.     ret    6
  1402. ModServ endp
  1403.  
  1404.  
  1405. ;-------------------------------
  1406. ; Place a single integer argument into dx
  1407. ; with a return code
  1408.  
  1409. arg1    proc    near
  1410.     push    bp
  1411.     mov    bp,sp
  1412.     push    ds
  1413.     lds    si,[bp+x+2]
  1414.     mov    dx,[si]        ; dx gets the argument
  1415.     int    21h
  1416.     mov    ah,0        ; clear ah for al return code
  1417.     pop    ds
  1418.     pop    bp
  1419.     ret
  1420. arg1    endp
  1421.  
  1422. ;--------------------------------
  1423. ; Place a single integer argument into bp
  1424. ; for use with time outs - with a return code
  1425.  
  1426. arg1t    proc    near
  1427.     push    bp
  1428.     mov    bp,sp
  1429.     push    ds
  1430.     lds    si,[bp+x+2]
  1431.     mov    bp,[si]        ; dx gets the argument
  1432.     int    21h
  1433.     mov    ah,0        ; clear ah for al return code
  1434.     pop    ds
  1435.     pop    bp
  1436.     ret
  1437. arg1t    endp
  1438.  
  1439.  
  1440.  
  1441. ;--------------------------------
  1442. ; Process an fcb address in a
  1443. ; function call with a return code
  1444.  
  1445. arg1f    proc    near
  1446.     push    bp
  1447.     mov    bp,sp
  1448.     push    ds
  1449.     lds    dx,[bp+x+2]    ; dx gets the argument
  1450.     int    21h
  1451.     mov    ah,0        ; clear ah for al return code
  1452.     pop    ds
  1453.     pop    bp
  1454.     ret
  1455. arg1f    endp
  1456.  
  1457.  
  1458. ;--------------------------------
  1459. ; Process a single string argument in a
  1460. ; function call with a return code
  1461.  
  1462. arg1a    proc    near
  1463.     push    bp
  1464.     mov    bp,sp
  1465.     push    ds
  1466.     lds    dx,[bp+x+2]    ; ptr to parameter string
  1467. ;    inc    dx        ; add 1 to get the address of the string
  1468.     int    21h
  1469.     mov    ah,0        ; clear ah for al return code
  1470.     pop    ds
  1471.     pop    bp
  1472.     ret
  1473. arg1a    endp
  1474.  
  1475.  
  1476.  
  1477. ;----------------------------
  1478. ; Perform a single integer argument
  1479. ; but without a return code
  1480.  
  1481. arg1wor proc    near
  1482.     push    bp
  1483.     mov    bp,sp
  1484.     push    ds
  1485.     lds    si,[bp+x+2]
  1486.     mov    dx,[si]        ; dx gets the arg (or ptr)
  1487.     int    21h
  1488.     pop    ds
  1489.     pop    bp
  1490.     ret
  1491. arg1wor endp
  1492.  
  1493.  
  1494. ;----------------------------
  1495. ; Perform a single string argument
  1496. ; but without a return code
  1497.  
  1498. arg1awor proc    near
  1499.     push    bp
  1500.     mov    bp,sp
  1501.     push    ds
  1502.     lds    dx,[bp+x+2]
  1503.     inc    dx        ; add 1 to get the start of the string
  1504.     int    21h
  1505.     pop    ds
  1506.     pop    bp
  1507.     ret
  1508. arg1awor endp
  1509.  
  1510.  
  1511. ;----------------------------
  1512. ; Handle a request$ and reply$ function
  1513. ; with error code
  1514.  
  1515. req_rep proc    near
  1516.     push    bp
  1517.     mov    bp,sp
  1518.     push    ds
  1519.     push    es
  1520.     lds    si,[bp+x+6]    ; ptr to req. string
  1521.     inc    si        ; add 1 to get the address of the string
  1522.     les    di,[bp+x+2]    ; ptr to var desc block for reply buf
  1523.     inc    di        ; add 1 to get the address of the string
  1524.     pushf            ; save the direction flag
  1525.     int    21h
  1526.     popf
  1527.     mov    ah,0
  1528.     pop    es
  1529.     pop    ds
  1530.     pop    bp
  1531.     ret
  1532. req_rep endp
  1533. cseg    ends
  1534.     end
  1535.